﻿function functionDiscard() {
    var idBooking = $("#ModelId").val();
    if (idBooking != 0) {
        var request = $.ajax({ url: del_URL,
            type: "GET",
            data: { idBooking: parseInt(idBooking) },
            dataType: "html",
            async: false
        });
        request.done(function (ans) {
            alert('Successfully deleted');
        });
    }
    else {
        alert('Discarded')
    }
    document.location.href = discard_URL;
}
